 		
 	String.prototype.trim=function(){
  		return this.replace(/(^\s*)|(\s*$)/g,"");
  	}
 		
 	function validate(){
  		if(validateTel()&&validateEmail()&&validateQQ()&&validateName()&&validateMobile()&&validateAddress()&&validateDate()){
  			return true;
  		}
  		return false;
  	}
  	
  	function validateName(){
  		var name=document.getElementById("name").value.trim();
  		if(name==""){
  			document.getElementById("nameId").style.display="block";
  			document.getElementById("nameId").innerHTML="<span style='color:red'>姓名不能为空</span>";
  			return false;
  		}
  		return true;
  		
  	}  	
  	
 	function validateQQ(){ 		
 		var qq=document.getElementById("qq").value;
 		 		
 		//验证QQ
 		var reg = /^[1-9]{1}[0-9]{6,11}$/;
 		if(qq==""||reg.test(qq)==false){
 			document.getElementById("qqId").style.display="block";
  			document.getElementById("qqId").innerHTML="<span style='color:red'>请填写正确的QQ号码</span>";
 			return false;
 		}
 		return true;
 	}	
 		
 	function validateEmail(){ 		
 		var email=document.getElementById("email").value;
 		 		
 		//验证邮箱
 		var reg = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/;
 		if(email==""||reg.test(email)==false){
 			document.getElementById("emailId").style.display="block";
  			document.getElementById("emailId").innerHTML="<span style='color:red'>请填写正确的邮箱地址</span>";
 			return false;
 		}
 		return true;
 	}
 	function validateTel(){
 		var offTel=document.getElementById("offTel").value;
 		//验证电话号码
 		var reg=/^[0-9]{3,4}\-[0-9]{7,8}$/;
 		if(offTel==""||reg.test(offTel)==false){
 			document.getElementById("offTelId").style.display="block";
  			document.getElementById("offTelId").innerHTML="<span style='color:red'>请填写正确的电话号码</span>";
 			return false;
 		}
 		return true;
 		
  	}
  	function validateMobile(){
  		var mobile=document.getElementById("mobile").value.trim();
  		var reg = /^[1-9]{1}[0-9]{10}$/;
  		if(mobile==""||reg.test(mobile)==false){
  			document.getElementById("mobileId").style.display="block";
  			document.getElementById("mobileId").innerHTML="<span style='color:red'>请填写正确的手机号码</span>";
  			return false;
  		}
  		return true;
  	}
  	function validateAddress(){
  		var address=document.getElementById("address").value.trim();
  		if(address==""){
  			document.getElementById("addressId").style.display="block";
  			document.getElementById("addressId").innerHTML="<span style='color:red'>地址不能为空</span>";
  			return false;
  		}
  		return true;
  	}
  	function validateDate(){
  		var birthDay=document.getElementById("birthId").value;
  		if(birthDay==""){
  			document.getElementById("birthIds").style.display="block";
  			document.getElementById("birthIds").innerHTML="<span style='color:red'>日期不能为空</span>";
  			return false;
  		}
  		return true;
  		
  	}
  	function validateGroup(){
  		var GroupName=document.getElementById("GroupNameId").value.trim();
  		if(GroupName==""){
  			  document.getElementById("GroupNameIds").style.display="block";
  			document.getElementById("GroupNameIds").innerHTML="<span style='color:red'>通讯组不能为空或者不能输入空格</span>";
  			return false;
  		}
  		return true;
  		
  	}
  	function validateDesc(){
  		var desc=document.getElementById("descId").value.trim();
  		if(desc==""){
  			document.getElementById("descIds").style.display="block";
  			document.getElementById("descIds").innerHTML="<span style='color:red'>通讯组内容不能为空或者不能输入空格</span>";
  			return false;
  		}
  		return true;
  		
  	}
  	
  	
  
 	function noneDiv(id){
  		document.getElementById(id).style.display="none";
  	}
 	
 	function vlidateGroups(){
 		if(validateGroup()&&validateDesc()){
 			return true;
 		} 		
 		return false;
 	}
